package factory;

import dao.Impl.PetDaoMySqlImpl;
import dao.Impl.PetDaoOracleImpl;
import dao.PetDao;

public class PetDaoFactory {
    public static String defaultBeanName="petDaoMySqlImpl";

    public static PetDao getInstance(String beanName){
        PetDao petDao=null;
        switch (beanName){
            case "petDaoMySqlImpl":
                petDao=new PetDaoMySqlImpl();
                break;
            case "petDaoOracleImpl":
                petDao=new PetDaoOracleImpl();
                break;
            default:
                throw new RuntimeException("未找到"+beanName+"对应的对象。");
        }
        return petDao;
    }
}
